.class public Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;
.super Landroid/os/AsyncTask;
.source "TopDeals.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lde/dealdoktor/app/activities/TopDeals;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "GetTopDealsTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/os/AsyncTask",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Void;",
        "Ljava/lang/Boolean;",
        ">;"
    }
.end annotation


# instance fields
.field private posts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lde/dealdoktor/app/data/PostDAO;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lde/dealdoktor/app/activities/TopDeals;


# direct methods
.method public constructor <init>(Lde/dealdoktor/app/activities/TopDeals;)V
    .locals 0
    .parameter

    .prologue
    .line 183
    iput-object p1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    .line 182
    invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V

    return-void
.end method


# virtual methods
.method protected varargs doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;
    .locals 3
    .parameter "args"

    .prologue
    .line 213
    :try_start_0
    invoke-static {}, Lde/dealdoktor/app/data/DataModel;->getTopDeals()Ljava/util/ArrayList;

    move-result-object v1

    iput-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->posts:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 218
    const/4 v1, 0x1

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    :goto_0
    return-object v1

    .line 214
    :catch_0
    move-exception v0

    .line 215
    .local v0, e:Ljava/lang/Exception;
    const-string v1, "exception"

    const-string v2, "GetPostsTask doInBackground"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 216
    const/4 v1, 0x0

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v1

    goto :goto_0
.end method

.method protected bridge varargs synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .parameter

    .prologue
    .line 1
    check-cast p1, [Ljava/lang/String;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->doInBackground([Ljava/lang/String;)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method protected onPostExecute(Ljava/lang/Boolean;)V
    .locals 3
    .parameter "success"

    .prologue
    const/16 v2, 0x8

    .line 198
    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_0

    .line 199
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

    .line 200
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    .line 208
    :goto_0
    return-void

    .line 204
    :cond_0
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->posts:Ljava/util/ArrayList;

    sput-object v0, Lde/dealdoktor/app/App;->topDeals:Ljava/util/ArrayList;

    .line 205
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->posts:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lde/dealdoktor/app/adapter/PostListAdapter;->addData(Ljava/util/ArrayList;)V

    .line 206
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v2}, Landroid/view/View;->setVisibility(I)V

    .line 207
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->removeFooterView(Landroid/view/View;)Z

    goto :goto_0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p0, p1}, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->onPostExecute(Ljava/lang/Boolean;)V

    return-void
.end method

.method protected onPreExecute()V
    .locals 5

    .prologue
    .line 188
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->addFooterView(Landroid/view/View;)V

    .line 189
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    new-instance v1, Lde/dealdoktor/app/adapter/PostListAdapter;

    sget-object v2, Lde/dealdoktor/app/App;->topDeals:Ljava/util/ArrayList;

    iget-object v3, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v4, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v4, v4, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    invoke-direct {v1, v2, v3, v4}, Lde/dealdoktor/app/adapter/PostListAdapter;-><init>(Ljava/util/ArrayList;Lde/dealdoktor/app/activities/SuperListing;Landroid/widget/ListView;)V

    iput-object v1, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    .line 190
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->results:Landroid/widget/ListView;

    iget-object v1, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v1, v1, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 191
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->loadingView:Landroid/view/View;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 192
    iget-object v0, p0, Lde/dealdoktor/app/activities/TopDeals$GetTopDealsTask;->this$0:Lde/dealdoktor/app/activities/TopDeals;

    iget-object v0, v0, Lde/dealdoktor/app/activities/TopDeals;->listAdapter:Lde/dealdoktor/app/adapter/PostListAdapter;

    invoke-virtual {v0}, Lde/dealdoktor/app/adapter/PostListAdapter;->clear()V

    .line 193
    return-void
.end method
